import React ,{Suspense}from 'react'

import {
  Routes,
  Route,
  Navigate,
  useRoutes,
} from 'react-router-dom'
import {routes} from './router'

const App = () => {
  const routesConfig = useRoutes(routes)

  return (
    <Suspense fallback={<div className='loading'>loading....</div>}>
      {routesConfig}
    </Suspense>
  )

}

export default App
